package services

import model "app/dao"

var PartnerService = NewPartnerService()

type partnerService struct{}

func NewPartnerService() *partnerService {
	return &partnerService{}
}

func (p *partnerService) FetchByUser(userid int) (list []model.Partner) {
	partner := &model.Partner{}
	list = partner.FetchByUser(userid)
	return
}

func (p *partnerService) FetchByAdmin() (list []model.Partner) {
	partner := &model.Partner{}
	list = partner.FetchByAdmin()
	return
}

func (p *partnerService) FetchByLeader(userid int) (list []model.Partner) {
	partner := &model.Partner{}
	list = partner.FetchByLeader(userid)
	return
}

func (p *partnerService) Insert(m model.Partner) (err error) {
	err = m.Insert()
	return
}

func (p *partnerService) Update(m model.Partner) (err error) {
	err = m.Update()
	return
}
